-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use xdg-desktop-portal on Linux #34
base: master
Are you sure you want to change the base?
Conversation
Hi, thanks for submitting this. The core philosophy of
as stated in the beginning of the README. That being said, in #30 we opened up the possibility to add external dependencies as |
I understand, that depending on other packages is something, you not want. I also try to keep the decencies as low as possible, but in this case, we have to use DBus. The current solution is hacky and may not work in every Environment while the solution provided here should work. Using optional dependencies here, is IMHO a bad Idea. Many people will just use Another way to solve this, would maybe using the gdbus cli. You can use it like this:
It should be installed on most Linux ditros, but there is no guarantee. It will output this:
2 is the number that we are interested. As you can see, the output is formatted. I don't know if this format will change the format in the future. That's the reason I haven't use it. There are other clis for dbus as well, but they are not installed on so many systems as gdbus. |
I apologize, but I disagree. The main users of Conversely, adding a mandatory dependency would force every user (in this case on Linux) to include and distribute the dependency in their software. This is not something to take lightly, especially when the software is frozen (with e.g PyInstaller). Specifically, I do not know how well
I completely agree, but the current solution was also proposed by other users and up to now it seems they were able to somehow benefit from having it.
If you want, you can attempt to add this as another detection method, and fall back to the existing method(s) in case there are issues (e.g. missing CLI tool or unexpected output format). |
The xdg-desktop-portals are a set of DBus Interfaces that are implemented by every Desktop Environment. They are also available in sandboxed Environments like Flatpak or Snap. They provide a standardized way to interact with the DE. You can detect the darkmode using portals, so you no longer need gsettings, but I kept the code for backwards compatibility.
This PR adds jeepney as Dependency for Linux. I also bumped the required Python version to 3.7, as jeepney requires this and 3.6 is out of support anyway.